package components
{
	import mx.managers.ISystemManager;
	import fbp.*
	
	public class get_ui_string extends NetworkComponent
	{	
		var previous_string:String = "";
		
		var _ui_controls:* = {"reversable_string":null};
		
		public function get_ui_string(system_manager:ISystemManager, ui_controls:*)
		{
			super(system_manager);
			
			if(ui_controls == null)
			{
				throw new Error("No controls were provided and they are needed for this component to be used.");
			}
			
			if("reversable_string" in ui_controls)
			{
				_ui_controls["reversable_string"] = ui_controls["reversable_string"];
				this.add_data(_ui_controls["reversable_string"].text);
			}
		}
		
		
		public override function process(data)
		{	
			if(previous_string != _ui_controls["reversable_string"].text)
			{
				this.add_data(_ui_controls["reversable_string"].text);
				previous_string = _ui_controls["reversable_string"].text
			}
			
			return data
		}
		
	}
}